export function login(isLogin) {
  return function (obj, name, describe) {
    let oldVal = describe.value;
    describe.value = function () {
      console.log('检查登录操作');
      if (isLogin) {
        return oldVal.apply(this, arguments)
      } else {
        console.log('你还没有登录')
      }
    };
    return describe
  };
}

export function emits(type, data) {
  return function (obj, name, describe) {
    let oldVal = describe.value;
    describe.value = function () {
      this.$emit(type, data.apply(this));
      return oldVal.apply(this, arguments)
    };
    return describe
  }
}

export function inspect(obj, name, describe) {
  describe.writable = false;
  return describe
}

export function enumerable(obj, name, describe) {
  describe.enumerable = false;
  return describe
}
